package com.dabai.iot.core.dto;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * 消息主题输入实体类
 *
 * @author kev1n
 */
@Data
public class ProductTopicInput implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 产品Id
     */
    @Schema(description = "产品Id")
    @JsonSerialize(using = ToStringSerializer.class)
    @NotNull
    private Long productId;

    /**
     * 主题
     */
    @Schema(description = "主题")
    @NotBlank
    private String topic;

    /**
     * 1:设备订阅 2:设备发布
     */
    @Schema(description = "1:设备订阅 2:设备发布")
    @NotNull
    private Integer topicDirection;

    /**
     * 描述
     */
    @Schema(description = "描述")
    private String topicDesc;

}
